package com.funmi.lizip.mapper;

import com.funmi.lizip.entity.Device;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.funmi.lizip.entity.dto.device.DeviceQueryRequest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zzy
 * @since 2022-11-02
 */
public interface DeviceMapper extends BaseMapper<Device> {

//    @Select("select * from device")
//    List<Device> getAll();




    @Select("select id from device where device_sn=#{deviceSn}")
    Integer getSn(String imei);



   // @Select("select type from device where id =#{deviceId}")
    //@Select("select d.type from image as i left join device as d on i.device_id = d.id")
   // List<String> getType(Integer deviceId);



    List<Device> getAll(DeviceQueryRequest device);


    @Select("select type from device where device_sn =#{imei}")
    String getType(String imei);
}
